package solver.moves;

import java.util.Random;

import model.IncrementalCostCalculator;
import model.IncrementalValidator;
import model.SolverEnvironment;
import model.Problem;
import model.Solution;

import command.Invoker;

public abstract class AbstractComplexMove extends AbstractMove{
	public static boolean isMathSolverBeenUsed=false;
	
	public AbstractComplexMove(SolverEnvironment env) {
		super(env);
	}

	long[] previousCostState;
	
	public boolean executeMove() {
		previousCostState = getCc().saveAndGetCostComponentMemory();
		return super.executeMove();
	}
		
	public void undo(){
		getInvoker().undoAllCommands();
		getCc().setAndRestoreCostComponentMemory(previousCostState);
	}

}
